%include "asm_io.inc"

segment .data
;
;initialized data is put in the data segment here
;
input dq 27

segment .bss
;
;uninitialized data is put in the bss segment
;
input2 resq 1
result resq 1

segment .text
;
;code here
;
	global asm_main
	extern croot

asm_main:
	enter 0,0	;setup
	pusha
	
	push result
	fild dword [input]
	fistp qword [input2]
	push input2
	call croot
	
	pop qword [input2]
	pop qword [result]
	
	fild qword [result]
	fistp dword [input]
	
	mov eax,[input]
	call print_int
	;do not remove code after this
	popa
	mov eax,0	;return back to C
	leave
	ret
	